Repository navigation
fix(pm-aggregator): show ready-for-agent dispatch state - #5283
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb0ac58833
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!targets.length) return []; | ||
| const observedAt = new Date().toISOString(); | ||
| try { | ||
| const state = await fetchRfaState(cfg.readyForAgent.baseUrl); |
There was a problem hiding this comment.
Keep fixture-mode dispatch reads off the live harness
When PM_AGG_SOURCE=fixtures (the default), opening the fixture dispatch-trial item now performs real GraphQL requests against the configured harness and attaches live dispatch state to canned issue data. Without a running harness, the same fixture instead reports unavailable, making this surface environment-dependent. The existing harness integration in health.ts explicitly skips live reads in fixtures mode. Apply the same boundary here and supply deterministic fixture dispatch data; the new boot test currently accepts unavailable because it only checks that the state is truthy.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 66db0aa: fixtures mode (cfg.source !== live) no longer calls fetchRfaState — readyAgentDispatchStates returns deterministic fixture data (RFA_NOT_PICKED_UP with mode=fixtures provenance), mirroring the health.ts boundary. The boot test now asserts the exact state "not picked up" instead of any truthy state.
| const matchedItemPath = itemJsonMatch ?? itemMatch; | ||
| if (matchedItemPath) { |
There was a problem hiding this comment.
Return a JSON error for unresolved API item IDs
When /api/item/<id>.json references an unknown or deleted item, this shared handler falls through to the existing HTML Not found response rather than returning JSON. A machine consumer parsing the JSON endpoint's response therefore receives a parsing error instead of a structured 404. Handle the API miss separately, using the existing notFoundResponse(path) helper or a JSON error response, while preserving the HTML response for /item/<id>.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 66db0aa: an unresolved /api/item/.json now returns notFoundResponse(path) (structured JSON 404) while /item/ keeps the HTML 404. Covered by a new boot test asserting JSON 404 + content-type for the API path and HTML 404 for the page path.
# Conflicts: # pm-stack/aggregator/src/render.ts # pm-stack/aggregator/src/server.ts # pm-stack/aggregator/test/render.test.ts
Summary
ready-for-agentlabel alone as evidence that work is implementing./api/item/:id.json, including provenance and explicitnot picked upstate.Closes #4969
Verification
bun test test/render.test.ts test/boot.test.ts test/ready-for-agent.test.ts— 48 passed.git diff --check— clean.bun run typecheckcould not run: the fresh worktree does not have thebuntype definitions installed (TS2688).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.